/***************************************************************************
 *   Copyright (C) 2008 by Eduardo Gurgel Pinho                            *
 *   edgurgel@gmail.com                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/

#ifndef __SCENE_TREE_H__
#define __SCENE_TREE_H__

#include "scene_tree_item.h"
#include "common/scene.h"
#include "common/color.h"
#include "light/light.h"
#include "light/punctual_light.h"
#include "light/square_light.h"
#include "object/object.h"
#include "object/sphere.h"
#include "object/plane.h"
#include "object/disc.h"
#include "object/triangle.h"
#include "object/quadrilateral.h"
#include "object/cone.h"
#include "object/cylinder.h"
#include "object/plane.h"
#include "material/material.h"
#include "math/vector.h"

#include <QTreeWidget>

namespace Ui {

class Scene_Tree : public QTreeWidget {

	Q_OBJECT

public:
	Scene_Tree(QWidget* = 0);
	~Scene_Tree(void);
	
	QSize minimumSizeHint() const;
	
	void insert_scene(Sirat::Common::Scene*);
	
public slots:
		
signals:	
	void material_selected(Sirat::Material::Material* _material);
	void object_selected(Sirat::Object::Object* _object);
	
private slots:
	void update_scene(QTreeWidgetItem*, int);
	void show_information(QTreeWidgetItem*,int);
	void reload_tree(void);
	

private:
	// Later we need to remove color and material treatment, because Material_Panel (should) do this job
	Scene_Tree_Item* add_color(const Sirat::Common::Color&,const QString&);
	Scene_Tree_Item* add_vector(const Sirat::Math::Vector&,const QString&);
	
	Scene_Tree_Item* add_objectlist(Sirat::Common::Scene*);
	Scene_Tree_Item* add_sphere(Sirat::Object::Sphere*,unsigned int);
	Scene_Tree_Item* add_plane(Sirat::Object::Plane*,unsigned int);
	Scene_Tree_Item* add_disc(Sirat::Object::Disc*,unsigned int);
	Scene_Tree_Item* add_cone(Sirat::Object::Cone*,unsigned int);
	Scene_Tree_Item* add_cylinder(Sirat::Object::Cylinder*,unsigned int);
	Scene_Tree_Item* add_triangle(Sirat::Object::Triangle*,unsigned int);
	Scene_Tree_Item* add_quadrilateral(Sirat::Object::Quadrilateral*,unsigned int);
	
	Scene_Tree_Item* add_lightlist(Sirat::Common::Scene*);
	Scene_Tree_Item* add_punctual_light(Sirat::Light::Punctual_Light*,unsigned int);
	Scene_Tree_Item* add_square_light(Sirat::Light::Square_Light*,unsigned int);
	
	Sirat::Common::Scene* scene;
};

}

#endif
